import './style.css'
import "virtual:uno.css";
import App from './App.vue'
import unoCssRuntime from "@unocss/runtime";
import config from "../vite/unocss/config";
import { createApp } from 'vue'
import { useStore } from "@/store"
//
unoCssRuntime({
    defaults: config
});

// 加载 svg 图标
import "virtual:svg-icons-register";


// 加载 iconify 图标
import { downloadAndInstall } from "@/iconify";
import icons from "@/iconify/index.json";

import TinyThemeTool from '@opentiny/vue-theme/theme-tool'

import { tinyAuroraTheme } from '@opentiny/vue-theme/theme'
(async ()=>{
    if (icons.isOfflineUse) {
        for (const info of icons.collections) {
            await downloadAndInstall(info);
        }
    }
    const app = createApp(App)
    const theme = new TinyThemeTool(tinyAuroraTheme, 'tinyStyleSheetId') // 初始化主题
    app.config.globalProperties.theme = theme // 将 theme 对象挂到 vue 实例中
    useStore(app)
    app.mount('#app')
})()


